<include file="Common:lefter" />
<div class="content-box">
    <div class="content-box-header">
    <h3>文章标签列表</h3>
    </div>
    <div class="content-box-content">
    <div class="tab-content default-tab">
      <table>
        <thead>
          <tr>
            <td colspan="4">
              <div class="bulk-actions align-right">
              	<a class="button" href="__APP__/ArticleTag/edit/?&p={$nowPage}">添加新标签</a>
              </div>
              <div class="clear"></div>
            </td>
          </tr>
          <tr>
            <th width="60">
              <input class="check-all" type="checkbox" />
            </th>
            <th>标签名</th>
            <th width="70">操作</th>
          </tr>
        </thead>
        <tfoot>
          <tr>
            <td colspan="7">
              <div class="bulk-actions align-left">
                <select name="dropdown">
                  <option value="option1">批量操作</option>
                  <option value="option2">删除</option>
                </select>
                <a class="button" href="#">应用</a> </div>
              <div class="pagination">
              {$page}
              </div>
              <!-- End .pagination -->
              <div class="clear"></div>
            </td>
          </tr>
        </tfoot>
        <tbody>
        <foreach name="list" item="tagList">
          <tr>
            <td>
              <input type="checkbox" />{$tagList.tag_id}
            </td>
            <td><a href="__APP__/ArticleTag/edit/tagId/{$tagList.tag_id}?&p={$nowPage}" title="{$tagList.tag_name}">{$tagList.tag_name}</a></td>
            <td>
            <a href="__APP__/ArticleTag/edit/tagId/{$tagList.tag_id}?&p={$nowPage}" title="编辑"><img src="__ROOT__/Public/Image/Admin/icons/pencil.png" alt="编辑" /></a>
            <a href="javascript:void(0);" onclick="deleteTag({$tagList.tag_id})" title="删除"><img src="__ROOT__/Public/Image/Admin/icons/cross.png" alt="删除" /></a></td>
          </tr>
        </foreach>
        </tbody>
      </table>
    </div>
    </div>
    </div>
<include file="Common:footer" />
<script type="text/javascript">
function deleteTag(tagId){
	var flag = true;
	$.ajax({
		url:'__APP__/ArticleTag/ajaxTagDeleteCheck?&tagId='+tagId,
		dataType:'json',
		type:'GET',
		async:false,
		success:function(data){
			if(!confirm(data.msg)){
				flag = false;
			}
		}
	});
	if(flag){
		location.href = '__APP__/ArticleTag/delete/tagId/'+tagId+'?&p={$nowPage}';
	}
}
</script>